extends Node2D
class_name PosGetter
var regionId=1
onready var _playerPosPlace:Node2D=$playerPosPlace
onready var _enemyPosPlace:Node2D=$enemyPosPlace
onready var battlePlace:Node2D=$battlePlace
var playerPoses=[]
var enemyPoses=[]
func _ready():
	if _playerPosPlace:
		var arr=_playerPosPlace.get_children()
		playerPoses.append_array(arr)
	if _enemyPosPlace:
		var arr=_enemyPosPlace.get_children()
		enemyPoses.append_array(arr)
		
func getRandomPlayerPos():
	var i=int(rand_range(0,playerPoses.size()))
	var pos=playerPoses[i].position
	pos.x+=rand_range(-10,10)
	pos.y+=rand_range(-10,10)
	return pos
func getRandomEnemyPos():
	var i=int(rand_range(0,enemyPoses.size()))
	var pos=enemyPoses[i].position
	pos.x+=rand_range(-10,10)
	pos.y+=rand_range(-10,10)
	return pos

